﻿using System;
using UnityEngine;

namespace RenderHeads.Media.AVProVideo.Demos
{
	// Token: 0x02000006 RID: 6
	[RequireComponent(typeof(Transform))]
	public class AutoRotate : MonoBehaviour
	{
		// Token: 0x06000020 RID: 32 RVA: 0x00002FB4 File Offset: 0x000011B4
		private void Awake()
		{
			this.Randomise();
		}

		// Token: 0x06000021 RID: 33 RVA: 0x00002FBC File Offset: 0x000011BC
		private void Update()
		{
			base.transform.Rotate(this.x * Time.deltaTime, this.y * Time.deltaTime, this.z * Time.deltaTime);
			this._timer -= Time.deltaTime;
			if (this._timer <= 0f)
			{
				this.Randomise();
			}
		}

		// Token: 0x06000022 RID: 34 RVA: 0x00003020 File Offset: 0x00001220
		private void Randomise()
		{
			float num = 32f;
			this.x = UnityEngine.Random.Range(-num, num);
			this.y = UnityEngine.Random.Range(-num, num);
			this.z = UnityEngine.Random.Range(-num, num);
			this._timer = UnityEngine.Random.Range(5f, 10f);
		}

		// Token: 0x04000014 RID: 20
		private float x;

		// Token: 0x04000015 RID: 21
		private float y;

		// Token: 0x04000016 RID: 22
		private float z;

		// Token: 0x04000017 RID: 23
		private float _timer;
	}
}
